<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/11/21 0021
  Time: 下午 3:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登入界面</title>
    <LINK rel="stylesheet" type="text/css" href="<c:url value="/css/mdui.css" />"/>
    <LINK rel="stylesheet" type="text/css" href="<c:url value="/css/test.css" />"/>
    <script language='javascript' src='<c:url value="/js/mdui.js" />'></script>
</head>
<body>
    <div class="mdui-container-fluid ">
        <div class="mdui-row ">
            <div class="mdui-col-xs-4  mdui-col-offset-xs-4">
                <form action="${pageContext.request.contextPath }/home/loginDo" id="login" method="post">
                <h1>登入</h1>
                <div class="mdui-textfield">
                    <i class="mdui-icon material-icons">account_circle</i>
                    <label class="mdui-textfield-label">User name</label>
                    <input class="mdui-textfield-input" name="username" type="text" placeholder="User name" />
                </div>
                <div class="mdui-textfield">
                    <i class="mdui-icon material-icons">lock</i>
                    <input class="mdui-textfield-input" name="password"  type="password" placeholder="Disabled" />
                </div>
                <button class="mdui-btn" id="submit" type="submit">登入</button>
                <button class="mdui-btn" id="other" type="button">其他</button>
                </form>
            </div>
        </div>

    </div>
</body>
<script >
    var $$ = mdui.JQ;
    $$('#other').on('click', function (e) {
        //alert("other");

        console.log('点击了 #other 元素');
    });
    $$('#submit').on('click', function (e) {
        alert("登入");

    });

</script>
</html>
<!--

$$.ajax({
method: 'POST',
url: './loginDo',
dataType:"json",
data:$$('form').serialize(),
success: function (data) {
if(data.code == "000000"){
alert(data.message);
}else{
alert(data.message);
}
console.log(data);
},
error: function (xhr, textStatus) {
// xhr 为 XMLHttpRequest 对象
// textStatus 为包含错误代码的字符串
console.log(xhr.toString());
console.log(textStatus);
}
});
-->